Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: 체감온도 계산식 구현 및 api 구현 #155

Merged
merged 6 commits into from
Jul 10, 2024
Merged

Conversation

seheonnn
Copy link
Contributor

@seheonnn seheonnn commented Jul 8, 2024

☝️Issue Number

🔎 Key Changes

  • 체감온도 계산식 구현
  • 체감온도 Kafka 연결

💌 To Reviewers

  • 주의사항
  • 찾아보니까 이런 조건에선 체감온도보다 기존 온도가 더 정확하다고 하네용
if (temp > 10 || wind < 4.8) {
	return temp;
}
  • 체감온도 계산식 카프카 -> api로 변경해서 머지할게요

@seheonnn seheonnn self-assigned this Jul 8, 2024
@seheonnn seheonnn requested review from jinho7 and DDonghyeo July 8, 2024 12:31
@@ -51,12 +51,4 @@ public void airKoreaTest(@RequestBody AirTestRequest request) throws URISyntaxEx
public void accuweatherTest(@RequestBody AccuweatherTestRequest request) throws URISyntaxException, IOException {
weatherService.convertLocation(request.latitude(), request.longitude());
}

@GetMapping("/converㅅ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 오타 주의해주세요 ㅡㅡ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocalDateTime을 문자열로 변환하는 로직이 있는데, 이를 별도의 유틸리티 클래스로 분리하면 좋을 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public class DateTimeUtil {
public static String convertLocalDateTimeToString(LocalDateTime time) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");
return time.format(formatter);
}

public static LocalDateTime convertLocalDateTimeToDailyWeatherTime(LocalDateTime time) {
    List<Integer> scheduledHours = Arrays.asList(0, 3, 6, 9, 12, 15, 18, 21);
    int currentHour = time.getHour();
    int adjustedHour = scheduledHours.stream()
        .filter(hour -> hour <= currentHour)
        .reduce((first, second) -> second)
        .orElse(scheduledHours.get(scheduledHours.size() - 1));

    if (currentHour < scheduledHours.get(0)) {
        time = time.minusDays(1);
    }
    return time.withHour(adjustedHour).withMinute(0).withSecond(0).withNano(0);
}

}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아이디어 감사합니당 🥵

@seheonnn seheonnn changed the title ✨ feat: 체감온도 계산식 구현 및 Kafka 연결 ✨ feat: 체감온도 계산식 구현 및 api 구현 Jul 9, 2024
@jinho7
Copy link
Contributor

jinho7 commented Jul 9, 2024

결국 돌고 돌아 api로.. 인정입니다.

@seheonnn seheonnn merged commit 390767d into develop Jul 10, 2024
1 check passed
@seheonnn seheonnn deleted the feat/#154 branch July 10, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ feat: 체감온도 api 연결
2 participants